[% setvar title Improvement needed in error messages (both internal errors and die function). %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p>Improvement needed in error messages (both internal errors and die function).</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: S. A. Janet &lt;<a href='mailto:stosh@eskimo.com'>stosh@eskimo.com</a>&gt;
  Date: 30 Sep 2000
  Mailing List: <a href='mailto:perl6-language-errors@perl.org'>perl6-language-errors@perl.org</a>
  Number: 359
  Version: 1
  Status: Developing</pre>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>Error messages should contain the word `ERROR' in them.  Messages due
to internal errors should contain `INTERNAL ERROR'.</p>
<p>Error messages should also contain the program name, or if that is not
known, the word `perl'.</p>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>Internal error messages should be improved. For example,</p>
<pre>                % perl -le 'print &quot;PRIME&quot; if (1 x shift) !~ /^(11+)\1+$/' 373403020102920303
                Out of memory!</pre>
<p>is a poor message. This is better: &quot;perl: FATAL ERROR: out of memory&quot;.</p>
<a name='IMPLEMENTATION'></a><h1>IMPLEMENTATION</h1>
<p>This should require very minor improvements to die and the addition of
a function e.g. setprogramname() to register the program name internally:</p>
<pre>                % cat foo.pl
                setprogramname( $0 );
                die &quot;filenames expected&quot; if ( $#ARGV &lt; 0 );
                ...
                $ perl foo.pl
                foo.pl: FATAL ERROR: filenames expected</pre>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<p>None.</p>
</div>
